package Yang.homework2;

/**
 * 编程实现对Manager类和Coder类的测试
 */
public class ManagerCoderTest {
    public static void main(String[] args) {
       //方法一、使用构造方法(String name, int id, int salary, int bonus)
       Manager manager = new Manager("一龙",123,15000,6000);
       manager.work();

       Coder coder = new Coder("方便",123,10000);
       coder.work();

        System.out.println("-------------------------------------------");
       //方法二，使用setter方式给属性赋值
        Manager manager1 = new Manager();
        manager1.setName("一龙");
        manager1.setId(123);
        manager1.setSalary(15000);
        manager1.setBonus(6000);
        manager1.work();

        Coder coder1 = new Coder();
        coder1.setName("方便");
        coder1.setId(123);
        coder1.setSalary(10000);
        coder1.work();
    }
}
